#pragma once
#include <string>
#include <iostream>
using namespace std;

class Student
{
protected:
	string firstName;
	string secondName;
	int enrollmentYear;
public:	
	Student() : firstName(""), secondName(""), enrollmentYear(0){}
	Student(string firstName, string secondName, int enrollmentYear)
	{
		
	}
	~Student(){}

	void SetfirstName(string firstName){this->firstName=firstName;}
	void SetsecondName(string secondName){this->secondName=secondName;}
	void SetenrollmentYear(int enrollmentYear){this->enrollmentYear=enrollmentYear;}

	string GetfirstName(){return firstName;}
	string GetsecondName(){return secondName;}
	int GetenrollmentYear(){return enrollmentYear;}

	void Read()
	{
		cout << "Firstname= ";
		cin >> firstName;
		cout << "Secondname= ";
		cin >> secondName;
		cout << "Enrollment year= ";
		cin >> enrollmentYear;

	}

	void Write()
	{
		cout << "Firstname= " << firstName << endl;
		cout << "Secondname= " << secondName << endl;
		cout << "Enrollment year= " << enrollmentYear << endl;
	}
	//Format (string Firstname, string Secondname, int Enrollment year)
	friend ostream& operator << (ostream& out, const Student& a)
	{
		out << "(";
		out << a.firstName << ",";
		out << a.secondName << ",";
		out << a.enrollmentYear << ")";
		return out;
	}

	friend istream& operator >> (istream& in, Student& a)
	{
		string s;
		getline(in, s, '(');
		getline(in, a.firstName, ',');
		getline(in, a.secondName, ',');
		in >> skipws >> a.enrollmentYear;
		getline(in, s, ')');
		return in;
	}

};



